home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inside Mac Games Volume 5 #3
/
IMG 46 Vol 5-3.iso
/
More Goodies
/
More For Your Game
/
Realmz
/
Character Master Source
/
Nemesis Framework
/
Sources
/
nemesis windows.cpp
< prev
Wrap
Text File
|
1996-07-03
|
2KB
|
82 lines
//••••••••••••••••••••••••••••••••••
// Some window utilites
//••••••••••••••••••••••••••••••••••
extern nemesisGlobalPtr G;
void NemesisGlobalToLocal ( WindowRef macWindow, Point globalPt, Point *localPt)
{
GrafPtr oldPort;
// preserve and set port
GetPort(&oldPort);
SetPort(macWindow);
// Convert the passed global point into local coords
*localPt = globalPt;
GlobalToLocal(localPt);
// Restore the port
SetPort(oldPort);
}
void NemesisLocalToGlobal (WindowRef macWindow, Point localPt, Point *globalPt)
{
GrafPtr oldPort;
// preserve and set port
GetPort(&oldPort);
SetPort(macWindow);
// Convert the passed local point into global coords
*globalPt = localPt;
LocalToGlobal(globalPt);
// Restore the port
SetPort(oldPort);
}
Boolean IsNemesisWindow( WindowRef theWindow )
{
Boolean isNemesisWindow = false;
if( theWindow )
{
isNemesisWindow = ( GetWindowKind( theWindow ) == kNemesisWindowKind );
}
return isNemesisWindow;
}
void NemesisForceUpdate( WindowRef theWindow )
{
GrafPtr oldPort;
Rect contentRect;
// preserve existing port and set Quickdraw port
GetPort( &oldPort );
SetPort( theWindow );
// get content area
contentRect = theWindow->portRect;
// generate update event for that area
InvalRect( &contentRect );
// restore port
SetPort( oldPort );
}
void NemesisForceUpdate( WindowRef theWindow, Rect theRect )
{
GrafPtr oldPort;
// preserve existing port and set Quickdraw port
GetPort( &oldPort );
SetPort( theWindow );
// generate update event for that area
InvalRect( &theRect );
// restore port
SetPort( oldPort );
}